package OnTheBeachDB::UserRole;
    
use base qw/DBIx::Class/;
    

# Load required DBIC stuff
__PACKAGE__->load_components(qw/PK::Auto Core/);
# Set the table name
__PACKAGE__->table('user_roles');
# Set columns in table
__PACKAGE__->add_columns(

    user_id => {
        data_type => 'INT',
        is_nullable => 0,
    },
    role_id => {
        data_type => 'INT',
        is_nullable => 0,
    },

);
# Set the primary key for the table
__PACKAGE__->set_primary_key(qw/user_id role_id/);
    
#
# Set relationships:
#
    
# belongs_to():
#   args:
#     1) Name of relationship, DBIC will create accessor with this name
#     2) Name of the model class referenced by this relationship
#     3) Column name in *this* table
__PACKAGE__->belongs_to(user => 'OnTheBeachDB::User', 'user_id');
    
# belongs_to():
#   args:
#     1) Name of relationship, DBIC will create accessor with this name
#     2) Name of the model class referenced by this relationship
#     3) Column name in *this* table
__PACKAGE__->belongs_to(role => 'OnTheBeachDB::Role', 'role_id');
    
    
=head1 NAME
    
    OnTheBeachDB::UserRole - A model object representing the JOIN between Users and Roles.
    
=head1 DESCRIPTION
    
    This is an object that represents a row in the 'user_roles' table of your application
    database.  It uses DBIx::Class (aka, DBIC) to do ORM.
    
    You probably won't need to use this class directly -- it will be automatically
    used by DBIC where joins are needed.
    
    
=cut
    
1;
